package junior.util;

/**
 * @author WuBo
 * @CreateDate 2013-11-15 下午2:35:52
 */
public class NumberUtils {

	public static double round(double f, int digits){
		double p = (double) Math.pow(10, digits);
		return Math.round(f * p) / p;
	}
	
	public static double floor(double f, int digits){
		double p = (double) Math.pow(10, digits);
		return ((int) Math.floor(f * p)) / p;
	}

}
